package beans;

import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import java.beans.VetoableChangeListener;
import java.beans.VetoableChangeSupport;
import java.io.Serializable;
import java.util.Collection;

public class Formation implements Serializable {

	private static final long serialVersionUID = 3130795005032702026L;

	private int numFormation;
	private String libelle;
	private String niveau;
	private String typeFormation;
	private String parcours;
	private ContratQuadriennal contrat;
	private Collection<Promotion> listePromotions;
	private Collection<UE> listeUE;

	PropertyChangeSupport changeSupport;
	VetoableChangeSupport vetoableSupport;
	
	public Formation() {}
	
	public Formation(int numFormation, String libelle, String niveau,
			String typeFormation, String parcours, ContratQuadriennal contrat) {
		super();
		this.numFormation = numFormation;
		this.libelle = libelle;
		this.niveau = niveau;
		this.typeFormation = typeFormation;
		this.parcours = parcours;
		this.contrat = contrat;
		this.listePromotions = null;
		this.listeUE = null;
	}

	public Collection<UE> getListeUE() {
		return listeUE;
	}

	public void setListeUE(Collection<UE> listeUE) {
		this.listeUE = listeUE;
	}
	
	public Collection<Promotion> getListePromotions() {
		return listePromotions;
	}

	public void setListePromotions(Collection<Promotion> listePromotions) {
		this.listePromotions = listePromotions;
	}
	
	public int getNumFormation() {
		return numFormation;
	}
	
	public void setNumFormation(int numFormation) {
		this.numFormation = numFormation;
	}
	
	public String getLibelle() {
		return libelle;
	}
	
	public void setLibelle(String libelle) {
		this.libelle = libelle;
	}
	
	public String getNiveau() {
		return niveau;
	}
	
	public void setNiveau(String niveau) {
		this.niveau = niveau;
	}
	
	public String getTypeFormation() {
		return typeFormation;
	}
	
	public void setTypeFormation(String typeFormation) {
		this.typeFormation = typeFormation;
	}
	
	public String getParcours() {
		return parcours;
	}
	
	public void setParcours(String parcours) {
		this.parcours = parcours;
	}
	
	public ContratQuadriennal getContrat() {
		return contrat;
	}
	
	public void setContrat(ContratQuadriennal contrat) {
		this.contrat = contrat;
	}
	
	public synchronized void addPropertyChangeListener(PropertyChangeListener listener) {
		changeSupport.addPropertyChangeListener(listener);
	}
	
	public synchronized void removePropertyChangeListener(PropertyChangeListener listener) {
		changeSupport.removePropertyChangeListener(listener);
	}
	
	public synchronized void addVetoableChangeListener(VetoableChangeListener listener) {
		vetoableSupport.addVetoableChangeListener(listener);
	}
	
	public synchronized void removeVetoableChangeListener(VetoableChangeListener listener) {
		vetoableSupport.removeVetoableChangeListener(listener);
	} 
}
